


#include "my_task.h"
#include "my_obs.h"

#include "tbb/tick_count.h"
#include "tbb/tbb_thread.h"
#include "tbb/task_scheduler_init.h"

#include <iostream>
#include <string>


int main(int argc, char** argv){


	::tbb::task_scheduler_init init(::tbb::task_scheduler_init::default_num_threads());
	::std::cout << "Hello!" << ::std::endl;

	::tbb::task_scheduler_observer * to = new ::pilot::my_obs;
	//to->observe(true);

//	::tbb::task_list tl;
//
//	tl.push_back( *new(::tbb::task::allocate_root()) ::pilot::my_task(FLOPS,"_",0) );
//	tl.push_back( *new(::tbb::task::allocate_root()) ::pilot::my_task(FLOPS,"%",0) );
//	tl.push_back( *new(::tbb::task::allocate_root()) ::pilot::my_task(FLOPS,"=",0) );
//	tl.push_back( *new(::tbb::task::allocate_root()) ::pilot::my_task(FLOPS,"\\",0) );
//	::tbb::task::spawn_root_and_wait(tl);

	::tbb::task::spawn_root_and_wait( *new(::tbb::task::allocate_root()) ::pilot::my_task(FLOPS,"_",0) );

	delete to;
	::std::cout << "Bye!" << ::std::endl;
	return 0;
}
